StringCaseSense


Determines whether string comparisons are case sensitive (default is "not case sensitive").

StringCaseSense, On|Off|Locale

Parameters

On|Off|Locale

On: String comparisons are case sensitive. This setting also makes the expression equal sign operator (=) and the case-insensitive mode of InStr() use the locale method described below.

Off: The letters A-Z are considered identical to their lowercase counterparts. This is the starting default for all scripts due to backward compatibility and performance (Locale is 1 to 8 times slower than Off depending on the nature of the strings being compared).

Locale [v1.0.43.03+]: String comparisons are case insensitive according to the rules of the current user's locale. For example, most English and Western European locales treat the letters A-Z and ANSI letters like Ä and Ü as identical to their lowercase counterparts. This setting applies to:

  • Expression equal sign operator (=).
  • InStr(): When its CaseSensitive parameter is omitted or false, it uses the locale method of insensitivity instead of the "A-Z only" method.
  • All other commands, functions, and operators that are documented as obeying StringCaseSense.

Remarks

The command affects the behavior of IfEqual (and its family), IF (expression), IfInString, StringReplace and StringGetPos, and others that are explicitly documented as obeying StringCaseSense.

The built-in variable A_StringCaseSense contains the current setting (the word On, Off, or Locale).

Every newly launched thread (such as a hotkey, custom menu item, or timed subroutine) starts off fresh with the default setting for this command. That default may be changed by using this command in the auto-execute section (top part of the script).

Related

IfEqual, IfInString, if var between, StringReplace, StringGetPos

Example

StringCaseSense Locale